<?php

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;
class ReportModel extends Model
{
    protected $name = 'report';
    use SoftDelete;
    protected $deleteTime = 'delete_time';

    protected $defaultSoftDelete = 0;

    public function img()
    {
        return $this->hasMany(ReportImgModel::class,'report_id');
    }

    public function user()
    {
        return $this->belongsTo(UserModel::class,'user_id');
    }

    public function getLocationAttr($value)
    {
        return json_decode($value,true);
    }

}